import request from "@/utils/request";
import {AxiosPromise} from "axios";
import {CrawlInstanceForm, CrawlInstancePageResult, CrawlInstanceQuery,} from "./types";

/**
 * 爬虫空间分页列表
 *
 * @param data
 */
export function getPage(data: CrawlInstanceQuery): AxiosPromise<CrawlInstancePageResult> {
	return request({
		url: "/api/v1/crawl/instance/page",
		method: "post",
		data: data,
	});
}

/**
 * 爬虫空间表单数据
 *
 * @param id
 */
export function getForm(id: number): AxiosPromise<CrawlInstanceForm> {
	return request({
		url: "/api/v1/crawl/Instance/" + id + "/form",
		method: "get",
	});
}
